class Play {
  ctx: any;
  battleList: any[];
  setBattleList: any;

  constructor(ctx: any, battleList: any[], setBattleList: any) {
    this.ctx = ctx;
    this.battleList = battleList;
    this.setBattleList = setBattleList;
    console.log(333);
  }

  draw() {
    // console.log(this.battleList)
    const y = Math.floor(Math.random() * 300)
    this.ctx.fillStyle = "#f00000";
    this.ctx.fillRect(20, y, 100, 100);
    this.ctx.fillStyle = "rgba(34, 34, 201, 0.5)";
    this.ctx.fillRect(200, 200, 100, 200);
    this.ctx.font = "50px  Arial";
    this.ctx.strokeText("asdadasd", 100, 100);
    // console.log('绘制中', this);
  }

  start(): void {
    // console.log(11111, this);

    //this.draw();
  }
}

// (ctx: any, battleList: any[], setBattleList: any) => {
//   ctx.fillStyle = "#f00000";
//   ctx.fillRect(20, 20, 100, 100);
//   ctx.fillStyle = "rgba(34, 34, 201, 0.5)";
//   ctx.fillRect(200, 200, 100, 200);
//   ctx.font = "50px  Arial";
//   ctx.strokeText("asdadasd", 100, 100);

//   const list: any = [];
//   for (let i = 0; i < battleList.length; i++) {
//     // console.log(battleList[i]);
//     const item = battleList[i];
//     const itemObj = {
//       ...item,
//       column: item.column + 1,
//     };
//     list.push(itemObj);
//   }
// //   console.log(battleList);

//   setBattleList(list);
// };

export default Play;
